﻿
<div ng-controller="CsvExportController">
    <div class="mt10 clearfix">
        <dl class="CSVExport clearfix">
            <dt>
                {{texts['lb-store']}}
            </dt>
            <dd>
                <select class="CBB w110" ng-model="myStore"  ng-change="update()">
                    <option ng-repeat="store in rowsStoreList" value="{{ store.Name }}">{{store.Name}}</option>
                </select>
            </dd>
        </dl>
        <dl class="CSVExport clearfix">
            <dt>
                {{texts['lb-output-date']}}
            </dt>
            <dd>
                <ul class="fleft listDoc clearfix">
                    <li><input id="1" checked="checked" name="R1" type="radio" ng-model="radioSelect" value="1"/>{{texts['lb-tighten-month-output']}}</li>
                    <li><input id="2" name="R1" type="radio" ng-model="radioSelect" value="2"/>{{texts['lb-any-setting-output']}}</li>
                    <li>
                        <input ng-disabled="isRadioSelected('1')"  type="text" datepicker-popup="{{format}}" ng-model="dfrom" is-open="openMonth" max-date="'2020-06-22'" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
                        <button ng-disabled="isRadioSelected('1')"  type="button" class="btn btn-default colorBlack" ng-click="open($event,'openMonth')"><i ng-disabled="isRadioSelected('1')" class="glyphicon glyphicon-calendar"></i></button><br>
                    </li>
                    <li> <input ng-disabled="isRadioSelected('1')" id="Checkbox1" type="checkbox" ng-model="Checked"/>{{texts['lb-only-specificdate']}}<br>
                    </li>
                    <li>
                        <input ng-disabled="!Checked" type="text" datepicker-popup="{{format2}}" ng-model="dfrom" is-open="openedDayForm" max-date="'2020-06-22'" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
                        <button  ng-disabled="!Checked" type="button" class="btn btn-default colorBlack" ng-click="open($event,'openedDayForm')"><i  ng-disabled="!Checked" class="glyphicon glyphicon-calendar"></i></button><br>
                    </li>
                    <li>
                        <input ng-disabled="!Checked" type="text" datepicker-popup="{{format2}}" ng-model="dto" is-open="openedDayTo" max-date="'2020-06-22'" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
                        <button ng-disabled="!Checked" type="button" class="btn btn-default colorBlack" ng-click="open($event, 'openedDayTo')"><i ng-disabled="!Checked"  class="glyphicon glyphicon-calendar"></i></button>
                    </li>
                </ul>
            </dd>
        </dl>
        <dl class="CSVExport clearfix">
            <dt>
                {{texts['lb-target-staff']}}
            </dt>
            <dd>
                <input id="Radio3" checked="true" name="R2" type="radio" value="" ng-model="myRadioFilter.ContractType"/>{{texts['lb-all']}}
                <input id="Radio4" name="R2" type="radio" value="1" ng-model="myRadioFilter.ContractType"/>{{texts['lb-only-staff']}}
                <input id="Radio5" name="R2" type="radio" value="2" ng-model="myRadioFilter.ContractType"/>{{texts['lb-only-pa']}}
                <input id="Radio6" name="R2" type="radio" value="" ng-model="myRadioFilter.ContractType"/>{{texts['lb-optional']}}
            </dd>
        </dl>
    </div>
    <div class="clearfix">
        <table class="tableKind-01 w760">
            <tr ng-repeat="row in staffList | filter : myStore | filter : myRadioFilter">
                <td><input id="check1" type="checkbox" value="row.index"/></td>
                <td>{{row.Name}}</td>
                <td>{{row.ContractType == 1 ?"Staff":row.ContractType == 2?"Contract Staff":row.ContractType == 3 ?" Part staff":"Part Time staff"}}</td>
                <td>{{row.StoreName}}</td>
            </tr>
        </table>
    </div>
    <div class="center clearfix">
        <button ng-click="csvExport()" ng-csv="">{{texts['btn-export-csv']}}</button>
    </div>

</div>
